
package com.hlkj.pay.gateway.profit;
/*
 * Hlpay-Plus aggregate payment system.
 * Copyright (c) 2024-2025 Hlpay Team Copyright has the right of final interpretation.
 */

import java.util.List;

import javax.servlet.http.HttpServletRequest;

import com.hlkj.framework.common.pojo.CommonResult;
import com.hlkj.pay.app.merchant.ext.dto.profit.ChannelProfitOrderContext;
import com.hlkj.pay.dto.order.PayOrderFundDto;
import com.hlkj.pay.dto.order.ProfitOrderResultDto;
import com.hlkj.pay.dto.order.RefundOrderFundDto;
import com.hlkj.pay.infrastructure.model.order.OrderFundDO;
import com.hlkj.pay.infrastructure.model.order.OrderFundDetailDO;
import com.hlkj.pay.infrastructure.model.order.PayOrderDO;

/**
 * 分润订单
 * 
 * @author HlpayTeam
 * @date 2024/11/07 11:04
 */
public interface IChannelProfitOrderGateway {

    /**
     * 通道实现校验
     *
     * @param channelCode
     * @return
     */
    boolean extensionExist(String channelCode);

    /**
     * 提交分账
     * 
     * @param payOrderDO
     * @return
     */
    ProfitOrderResultDto submitProfitOrder(PayOrderDO payOrderDO, List<PayOrderFundDto> payOrderFundList);

    /**
     * 分账查询
     * 
     * @param payOrderDO
     * @return
     */
    ProfitOrderResultDto queryProfitOrder(PayOrderDO payOrderDO, List<OrderFundDetailDO> payOrderFundList);

    /**
     * 提交分账
     *
     * @param payOrderDO
     * @return
     */
    ProfitOrderResultDto submitProfitRefundOrder(PayOrderDO payOrderDO, List<RefundOrderFundDto> payOrderFundList);

    /**
     * 分账查询
     *
     * @param payOrderDO
     * @return
     */
    ProfitOrderResultDto queryProfitRefundOrder(PayOrderDO payOrderDO, List<OrderFundDetailDO> payOrderFundList);

    /**
     *
     * @param payOrderDO
     * @param payOrderFund
     * @return
     */
    ProfitOrderResultDto finishAcctOrder(PayOrderDO payOrderDO, OrderFundDO payOrderFund);


    CommonResult<String> acctStatusParse(HttpServletRequest request, ChannelProfitOrderContext channelProfitOrderContext);


    CommonResult<String> settleConfirm(PayOrderDO payOrderDO);
}
